<template>
    <!-- 分销订单 -->
    <div>
        <div class="head">
            <span>分销订单</span>
        </div>
        <div class="head-1">
            <div class="head-1-x">
                <div class="head-1-x-a">
                    <span>订单搜索</span>
                    <select v-model="value1">
                        <option value="订单号">订单号</option>
                        <option value="商品名称">商品名称</option>
                        <option value="买家昵称">买家昵称</option>
                        <option value="买家手机号">买家手机号</option>
                        <option value="收货人姓名">收货人姓名</option>
                        <option value="收货人手机号">收货人手机号</option>
                        <option value="商品货号">商品货号</option>
                    </select>
                    <input type="text" placeholder="输入订单号搜索" v-model="value2">
                </div>
                <div>
                    <span>下单时间</span>
                    <el-date-picker
                  v-model="value3"
                  type="date"
                  :default-value="new Date(2023, 5, 5)"
                  format="YYYY/MM/DD"
                  value-format="YYYY-MM-DD"
                  style="width: 120px;"
                />
                <span>至</span>
                <el-date-picker
                  v-model="value4"
                  type="date"
                  :default-value="new Date(2023, 5, 5)"
                  format="YYYY/MM/DD"
                  value-format="YYYY-MM-DD"
                  style="width: 120px;"
                /> 
                </div>
                <div class="head-1-x-c">
                    <span>订单来源</span>
                    <select v-model="value4">
                        <option value="全部">全部</option>
                        <option value="微信小程序">微信小程序</option>
                        <option value="公众号">公众号</option>
                    </select>
                </div>
            </div>
            <div class="head-1-y">
                <span>佣金状态</span>
                <select v-model="value5">
                        <option value="全部">全部</option>
                        <option value="待结算">待结算</option>
                        <option value="已结算">已结算</option>
                </select>
                <button class="xuan">筛选</button>
                <button class="qin">清空</button>
            </div>
        </div>
        <div class="view">
            <div class="tb">
                <div class="tbHead">
                    <div style="width: 30%;">商品描述</div>
                    <div style="width: 12%;">单价/数量</div>
                    <div style="width: 18%;">买家/收货人</div>
                    <div style="width: 10%;">商品实付金额</div>
                    <div style="width: 8%;">商品利润</div>
                    <div style="width: 7%;">佣金状态</div>
                    <div style="width: 15%;">操作</div>
                </div>

                <div class="tbItem" v-for="item in tableData1.tableData">
                    <div class="itemTop">
                        <span>下单时间：{{ item.date}}</span>
                        <span>订单号：{{ item.orderon }}
                        </span>
                        <span>{{item.source}}</span>
                    </div>
                    <div class="itemContent">
                        <div class="item item-head" style="width: 30%;">
                            <img :src="item.imagurl" alt="">
                            <span>{{item.source}}</span>
                        </div>
                        <div class="item" style="width: 12%;">
                            ￥{{item.money}}x{{ item.number }}
                        </div>
                        <div class="item" style="width: 18%;">
                            {{item.mname}}/{{ item.sname }}
                        </div>
                        <div class="item" style="width: 10%;">{{item.payment}}</div>
                        <div class="item" style="width: 8%;">{{item.profit}}</div>
                        <div class="item" style="width: 7%;">{{item.status}}</div>
                        <div class="item caozuo" style="width: 15%;">
                            <div>
                            <span>一级佣金:{{item.childer.one}}</span>
                            <br>
                            <span>分销员:{{item.childer.ren}}</span>
                            </div>

                            <div>
                                <span>二级佣金:{{item.childer.two}}</span>
                                <br>
                                <span>分销员:{{item.childer.ren2}}</span>
                            </div>
                            <div>
                                <span>三级佣金:{{item.childer.three}}</span>
                                <br>
                                <span>分销员:{{item.childer.ren3}}</span>
                            </div>
                        </div>
                    </div>
                </div>
        </div>

        <div class="pagination">
            <el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" background
                layout="prev, pager, next, jumper" :total="Total" @current-change="currentChange" />
        </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import { reactive, ref } from 'vue';
const value1=ref() //订单搜索选项
const value2=ref() //订单搜索
const value3=ref() //下单时间
const value4=ref() //
const value5=ref()

const tableData1=reactive({
    tableData:[{
        date:new Date().toLocaleString(), 
        orderon:'wx123123',
        source:"微信小程序",
        imagurl:'../../../public/mima.png',
        miao:"商品名称",
        money:"20",
        number:'1',
        mname:"国信安",
        sname:"梦魇",
        payment:"~~",
        profit:"0",
        status:"噩梦",
        childer:{
            one:'20',
            ren:'蒲公英',
            two:"10",
            ren2:"dandelion",
            three:'5',
            ren3:'w'
        }
    }]
})
//分页的东西
const currentPage = ref(1)
const Total=ref(10)
const pageSize = ref(5)
const currentChange = (current: any) => {
    currentPage.value = current
    console.log(current);
}
</script>

<style scoped lang="less">
.head{
    width: 100%;
    height: 40px;
    background-color: white;
    span{
        margin-left: 10px;
        line-height: 40px;
        font-size: 14px;
    }
    border-radius: 5px;
}
.head-1{
    background-color: white;
    width: 100%;
    height:200px;
    border-radius: 5px;
    margin-top: 20px;
    box-sizing: border-box;
    padding: 20px;
    color: #504f4f;
    span{
        margin-right: 10px;
        margin-left: 10px;
    }
    .head-1-x{
        display: flex;
        width: 100%;
        height:50%;
        align-items: center;

    }
    .head-1-y{
        display: flex;
        width: 100%;
        height:50%;
        align-items: center;
        span{
            margin-right: 10px;
        }
        select{
            width: 90px;
            height:34.5px;
        }
    }
    .head-1-x-a{
        display: flex;
        align-items: center;
        select{
            width: 90px;
            height:34.5px;
        }
        input{
            width: 200px;
            height:31px;
            border-left: 0 !important;
            border: 1px solid black;
            text-align: center;
            margin-right: 25px;
        }
    }
}
.head-1-x-c{
    display: flex;
    align-items: center;
    span{
        margin-left: 30px;
        
    }
    select{
            width: 120px;
            height:34.5px;
        }
}
// 2个按钮
.xuan{
    width: 60px;
    height: 30px;
    background-color: #ed742f;
    color: #ffffff ;
    border: 0;
    border-radius: 5px;
    margin-left: 20px
}
.qin{
    width: 60px;
    height: 30px;
    background-color: #ffffff;
    color: #ed742f ;
    border: 0;
    border-radius: 5px;
    margin-left: 20px;
}
// 表格内容
.view{
    margin-top: 10px;
    background:white;
    border-radius: 5px;
    width: 100%;
    height:700px
}
.tb {
    width: 100%;
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    .tbHead {
        margin: 20px 0;
        height: 50px;
        width: 99%;
        display: flex;
        background-color: #f2f2f2;

        div {
            font-size: 14px;
            font-weight: 600;
            display: flex;
            justify-content: center;
            align-items: center;
        }
    }

    .tbItem {
        width: 99%;
        height: 175px;
        box-shadow: 5px 5px 7px 0px #acabab;

        .itemTop {
            font-size: 12px;
            width: 100%;
            height: 35px;
            background-color: #f2f2f2;
            display: flex;
            align-items: end;

            span {
                margin: 0 0 5px 20px;
            }
        }

        .itemContent {
            width: 100%;
            height: 140px;
            display: flex;

            .item {
                display: flex;
                justify-content: center;
                align-items: center;
                box-sizing: content-box;
                border-left: 1px solid #f2f2f2;

            }

            .caozuo {
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                font-size: 12px;
            }
        }
        .item-head{
            width: 100%;
            text-align: left !important;
            justify-content: flex-start !important;
            margin-left: 10px;
            img{
                width: 40px;
                height: 40px;
            }
        }
    }
}
.pagination {
    margin: 25px;
    display: flex;
    justify-content: end;
}
</style>